import request from '@/utils/request'

// 查询商家用户关联列表
export function listRelation(query) {
  return request({
    url: '/lkshop/relation/list',
    method: 'get',
    params: query
  })
}

// 查询商家用户关联详细
export function getRelation(id) {
  return request({
    url: '/lkshop/relation/' + id,
    method: 'get'
  })
}

// 新增商家用户关联
export function addRelation(data) {
  return request({
    url: '/lkshop/relation',
    method: 'post',
    data: data
  })
}

// 修改商家用户关联
export function updateRelation(data) {
  return request({
    url: '/lkshop/relation',
    method: 'put',
    data: data
  })
}

// 删除商家用户关联
export function delRelation(id) {
  return request({
    url: '/lkshop/relation/' + id,
    method: 'delete'
  })
}

// 获取当前用户的商家信息
export function getMyBusiness() {
  return request({
    url: '/lkshop/relation/myBusiness',
    method: 'get'
  })
}

// 获取当前用户的所有商家信息
export function getMyBusinessList() {
  return request({
    url: '/lkshop/relation/myBusinessList',
    method: 'get'
  })
}

// 调试接口 - 获取当前用户ID和商家关联信息
export function debugBusinessRelation() {
  return request({
    url: '/lkshop/relation/debug',
    method: 'get'
  })
}
